package com.qf.ayc.vips.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.ayc.income.entity.Income;
import com.qf.ayc.utils.ResultVo;
import com.qf.ayc.vips.entity.Vips;
import com.qf.ayc.vips.mapper.VipsMapper;
import com.qf.ayc.vips.service.IVipsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author BeautyFairy
 * @since 2024-02-20
 */
@Slf4j
@Service
public class VipsServiceImpl extends ServiceImpl<VipsMapper, Vips> implements IVipsService {
    @Autowired
    private VipsMapper vipsMapper;

    @Override
    public void delete(String id) {
        vipsMapper.deleteById(id);
    }


    @Override
    public List<Vips> getlist() {
        QueryWrapper<Vips> queryWrapper = new QueryWrapper<>();
        List<Vips> orders = vipsMapper.selectList(queryWrapper);
        return orders;
    }

    @Override
    public List<Vips> getlist(Integer pageNum, Integer limit) {
        QueryWrapper<Vips> wrapper = new QueryWrapper<>();
        Page<Vips> page = new Page<>(pageNum, limit);
        vipsMapper.selectPage(page,wrapper);
        List<Vips> records = page.getRecords();
        log.info("分页所有的会员信息为={}",records);
        return records;
    }
}
